/**
 * @Author: XXHH
 * @CreateTime: 2025-05-05
 */
//class Point{
//    // x 和 y 坐标
//    private double x;
//    private double y;
//    public Point(double x,double y){
//        this.x = x;
//        this.y = y;
//    }
//    public Point(double r,double a){
//
//    }
//
//    public void print(){
//        System.out.println("打印点的坐标位置,x:"+this.x + "  y:"+this.y);
//    }
//}
class Point{
    private Double x;
    private Double y;
    private Double r;
    private Double a;

    public Double getX() {
        return x;
    }

    public void setX(Double x) {
        this.x = x;
    }

    public Double getY() {
        return y;
    }

    public void setY(Double y) {
        this.y = y;
    }

    public Double getR() {
        return r;
    }

    public void setR(Double r) {
        this.r = r;
    }

    public Double getA() {
        return a;
    }

    public void setA(Double a) {
        this.a = a;
    }
    public void print(){
        if (this.getX() != null && this.getY() != null){
            System.out.println("点的坐标位置,x:"+this.x + "  y:"+this.y);
        }
        if (this.getR() != null && this.getA() != null){
            System.out.println("点的坐标位置,a:"+this.a + "  r:"+this.r);
        }
    }
}
class PointFactory{
    public static Point makePointByXY(double x,double y){
        Point point = new Point();
        point.setX(x);
        point.setY(y);
        return point;
    }
    public static Point makePointByAR(double a,double r){
        Point point = new Point();
        point.setA(a);
        point.setR(r);
        return point;
    }

}
public class Demo44 {
    public static void main(String[] args) {
        Point point = PointFactory.makePointByXY(1.2,1.5);
        Point point2 = PointFactory.makePointByAR(10,1.5);
        point.print();
        point2.print();
    }
}
